package com.example.demo;

import com.example.OrgComparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class TestSort {

    public static void main(String[] args) {
        System.setProperty("java.util.Arrays.useLegacyMergeSort", "false");
        List<OrgUnit> orgUnitList = new ArrayList<>();
        while(true){
            orgUnitList.clear();
            orgUnitList.add(new OrgUnit("张三",12));
            orgUnitList.add(new OrgUnit("赵六",12));
            orgUnitList.add(new OrgUnit("赵六",11));
            Comparator<OrgUnit> comparator = new OrgComparator();
            Collections.sort(orgUnitList,comparator);
            orgUnitList.stream().forEach(System.out::println);
        }
    }
}

